Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: controller: Refactor ll c into states/roles files #15

Merged

Conversation

cvinayak
Copy link
Contributor

@cvinayak cvinayak commented Apr 29, 2017

Collection of commit to refactor ll.c file.


This change is Reviewable

@cvinayak cvinayak force-pushed the github_bluetooth_refactor_ll_c branch from fd12640 to 8c78e32 Compare April 29, 2017 14:21
@jhedberg jhedberg requested a review from Vudentz May 1, 2017 14:08
Vudentz
Vudentz previously approved these changes May 1, 2017
@cvinayak cvinayak changed the base branch from bluetooth to master May 1, 2017 18:37
@jhedberg jhedberg requested a review from carlescufi May 2, 2017 05:31
carlescufi
carlescufi previously approved these changes May 2, 2017
@jhedberg jhedberg self-requested a review May 2, 2017 10:05
@cvinayak cvinayak force-pushed the github_bluetooth_refactor_ll_c branch from 8c78e32 to caad338 Compare May 2, 2017 11:38
@cvinayak
Copy link
Contributor Author

cvinayak commented May 2, 2017

@jhedberg @carlescufi @Vudentz Please do the needful!

@cvinayak cvinayak force-pushed the github_bluetooth_refactor_ll_c branch from caad338 to 19c80cb Compare May 3, 2017 13:50
rsalveti pushed a commit to rsalveti/zephyr that referenced this pull request May 3, 2017
The current implementation of stm32_gpio_set() uses the GPIO output data
register to change the state of individual GPIOs. The generated
assembler needs at least 3 instructions: load / modify / store.

This opens a small race window, for example if a thread and an
interrupt both try to change the state of the same GPIO bank.

Use the GPIO bit set/reset register to perform the atomic change without
locking.

This also has the benefit of a more optimised implementation, which can
be useful for GPIO-intensive work. Compare the new version:

08000c98 <stm32_gpio_set>:
 8000c98:       f001 010f       and.w   r1, r1, zephyrproject-rtos#15
 8000c9c:       2301            movs    r3, zephyrproject-rtos#1
 8000c9e:       b902            cbnz    r2, 8000ca2 <stm32_gpio_set+0xa>
 8000ca0:       3110            adds    r1, zephyrproject-rtos#16
 8000ca2:       408b            lsls    r3, r1
 8000ca4:       6183            str     r3, [r0, zephyrproject-rtos#24]
 8000ca6:       2000            movs    r0, #0
 8000ca8:       4770            bx      lr

and the old one:

08000c98 <stm32_gpio_set>:
 8000c98:       2301            movs    r3, zephyrproject-rtos#1
 8000c9a:       f001 010f       and.w   r1, r1, zephyrproject-rtos#15
 8000c9e:       fa03 f101       lsl.w   r1, r3, r1
 8000ca2:       6943            ldr     r3, [r0, zephyrproject-rtos#20]
 8000ca4:       b10a            cbz     r2, 8000caa <stm32_gpio_set+0x12>
 8000ca6:       4319            orrs    r1, r3
 8000ca8:       e001            b.n     8000cae <stm32_gpio_set+0x16>
 8000caa:       ea23 0101       bic.w   r1, r3, r1
 8000cae:       6141            str     r1, [r0, zephyrproject-rtos#20]
 8000cb0:       2000            movs    r0, #0
 8000cb2:       4770            bx      lr

Change-Id: Ie5800d1c345016028d1b9a099f5d74cac35f592a
Signed-off-by: Florian Vaussard <[email protected]>
@cvinayak cvinayak force-pushed the github_bluetooth_refactor_ll_c branch from 19c80cb to 8ff2b85 Compare May 4, 2017 06:30
case BT_OCF(BT_HCI_OP_LE_CONN_UPDATE):
le_conn_update(cmd, evt);
break;

#if defined(CONFIG_BLUETOOTH_CONTROLLER_ROLE_MASTER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try to reorder the case statments so that each #if-#endif pair only appears once?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Lets see if this comment is lost!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this review/comment is not lost when doing git push -f.

@cvinayak cvinayak force-pushed the github_bluetooth_refactor_ll_c branch 2 times, most recently from aac5133 to 776a426 Compare May 4, 2017 10:06
cvinayak added 6 commits May 4, 2017 19:43
In preparation for refactoring the Controller implementation
into seperate state and role based source files, add Kconfig
options for states and roles in the Controller.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Move advertising state related implementation out into a
separate ll_adv.c file.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Move scanning state related implementation out into a
separate ll_scan.c file.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Move master role related implementation out into a separate
ll_master.c file.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Conditionally compile slave role related HCI commands.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Conditionally compile connection state related HCI commands.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@cvinayak cvinayak force-pushed the github_bluetooth_refactor_ll_c branch from 776a426 to 1433b32 Compare May 4, 2017 18:34
nagineni pushed a commit to nagineni/zephyr that referenced this pull request Nov 20, 2017
[AIO] Fixed incorrect comments in in AIO sample js
frasa pushed a commit to blik-GmbH/zephyr that referenced this pull request Mar 25, 2019
* Modified SoC init function configures COP WDT to time out after 8192ms
if CONFIG_WATCHDOG is set.
* A demo application shows how the WDT must be reloaded in order not to
time out.
* Closes zephyrproject-rtos#15
frasa added a commit to blik-GmbH/zephyr that referenced this pull request Mar 25, 2019
feat: WDT: added WDT demo application

Closes zephyrproject-rtos#15

See merge request blik/embedded/zephyr!25
finikorg pushed a commit to finikorg/zephyr that referenced this pull request Oct 25, 2019
Vudentz added a commit to Vudentz/zephyr that referenced this pull request Jun 18, 2020
This makes the gatt metrics also available for
gatt write-without-rsp-cb so it now prints the rate of each write:

uart:~$ gatt write-without-response-cb 1e ff 10 10
Write zephyrproject-rtos#1: 16 bytes (0 bps)
Write zephyrproject-rtos#2: 32 bytes (3445948416 bps)
Write zephyrproject-rtos#3: 48 bytes (2596929536 bps)
Write zephyrproject-rtos#4: 64 bytes (6400 bps)
Write zephyrproject-rtos#5: 80 bytes (8533 bps)
Write zephyrproject-rtos#6: 96 bytes (10666 bps)
Write zephyrproject-rtos#7: 112 bytes (8533 bps)
Write zephyrproject-rtos#8: 128 bytes (9955 bps)
Write zephyrproject-rtos#9: 144 bytes (11377 bps)
Write zephyrproject-rtos#10: 160 bytes (7680 bps)
Write zephyrproject-rtos#11: 176 bytes (8533 bps)
Write zephyrproject-rtos#12: 192 bytes (9386 bps)
Write Complete (err 0)
Write zephyrproject-rtos#13: 208 bytes (8533 bps)
Write zephyrproject-rtos#14: 224 bytes (9244 bps)
Write zephyrproject-rtos#15: 240 bytes (9955 bps)
Write zephyrproject-rtos#16: 256 bytes (8000 bps)

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
joerchan pushed a commit to joerchan/zephyr that referenced this pull request Jun 18, 2020
This makes the gatt metrics also available for
gatt write-without-rsp-cb so it now prints the rate of each write:

uart:~$ gatt write-without-response-cb 1e ff 10 10
Write zephyrproject-rtos#1: 16 bytes (0 bps)
Write zephyrproject-rtos#2: 32 bytes (3445948416 bps)
Write zephyrproject-rtos#3: 48 bytes (2596929536 bps)
Write zephyrproject-rtos#4: 64 bytes (6400 bps)
Write zephyrproject-rtos#5: 80 bytes (8533 bps)
Write zephyrproject-rtos#6: 96 bytes (10666 bps)
Write zephyrproject-rtos#7: 112 bytes (8533 bps)
Write zephyrproject-rtos#8: 128 bytes (9955 bps)
Write zephyrproject-rtos#9: 144 bytes (11377 bps)
Write zephyrproject-rtos#10: 160 bytes (7680 bps)
Write zephyrproject-rtos#11: 176 bytes (8533 bps)
Write zephyrproject-rtos#12: 192 bytes (9386 bps)
Write Complete (err 0)
Write zephyrproject-rtos#13: 208 bytes (8533 bps)
Write zephyrproject-rtos#14: 224 bytes (9244 bps)
Write zephyrproject-rtos#15: 240 bytes (9955 bps)
Write zephyrproject-rtos#16: 256 bytes (8000 bps)

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Vudentz added a commit to Vudentz/zephyr that referenced this pull request Jun 18, 2020
This makes the gatt metrics also available for
gatt write-without-rsp-cb so it now prints the rate of each write:

uart:~$ gatt write-without-response-cb 1e ff 10 10
Write zephyrproject-rtos#1: 16 bytes (0 bps)
Write zephyrproject-rtos#2: 32 bytes (3445948416 bps)
Write zephyrproject-rtos#3: 48 bytes (2596929536 bps)
Write zephyrproject-rtos#4: 64 bytes (6400 bps)
Write zephyrproject-rtos#5: 80 bytes (8533 bps)
Write zephyrproject-rtos#6: 96 bytes (10666 bps)
Write zephyrproject-rtos#7: 112 bytes (8533 bps)
Write zephyrproject-rtos#8: 128 bytes (9955 bps)
Write zephyrproject-rtos#9: 144 bytes (11377 bps)
Write zephyrproject-rtos#10: 160 bytes (7680 bps)
Write zephyrproject-rtos#11: 176 bytes (8533 bps)
Write zephyrproject-rtos#12: 192 bytes (9386 bps)
Write Complete (err 0)
Write zephyrproject-rtos#13: 208 bytes (8533 bps)
Write zephyrproject-rtos#14: 224 bytes (9244 bps)
Write zephyrproject-rtos#15: 240 bytes (9955 bps)
Write zephyrproject-rtos#16: 256 bytes (8000 bps)

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
carlescufi pushed a commit that referenced this pull request Jun 18, 2020
This makes the gatt metrics also available for
gatt write-without-rsp-cb so it now prints the rate of each write:

uart:~$ gatt write-without-response-cb 1e ff 10 10
Write #1: 16 bytes (0 bps)
Write #2: 32 bytes (3445948416 bps)
Write #3: 48 bytes (2596929536 bps)
Write #4: 64 bytes (6400 bps)
Write #5: 80 bytes (8533 bps)
Write #6: 96 bytes (10666 bps)
Write #7: 112 bytes (8533 bps)
Write #8: 128 bytes (9955 bps)
Write #9: 144 bytes (11377 bps)
Write #10: 160 bytes (7680 bps)
Write #11: 176 bytes (8533 bps)
Write #12: 192 bytes (9386 bps)
Write Complete (err 0)
Write #13: 208 bytes (8533 bps)
Write #14: 224 bytes (9244 bps)
Write #15: 240 bytes (9955 bps)
Write #16: 256 bytes (8000 bps)

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Vudentz added a commit to Vudentz/zephyr that referenced this pull request Jun 24, 2020
This makes the gatt metrics also available for
gatt write-without-rsp-cb so it now prints the rate of each write:

uart:~$ gatt write-without-response-cb 1e ff 10 10
Write zephyrproject-rtos#1: 16 bytes (0 bps)
Write zephyrproject-rtos#2: 32 bytes (3445948416 bps)
Write zephyrproject-rtos#3: 48 bytes (2596929536 bps)
Write zephyrproject-rtos#4: 64 bytes (6400 bps)
Write zephyrproject-rtos#5: 80 bytes (8533 bps)
Write zephyrproject-rtos#6: 96 bytes (10666 bps)
Write zephyrproject-rtos#7: 112 bytes (8533 bps)
Write zephyrproject-rtos#8: 128 bytes (9955 bps)
Write zephyrproject-rtos#9: 144 bytes (11377 bps)
Write zephyrproject-rtos#10: 160 bytes (7680 bps)
Write zephyrproject-rtos#11: 176 bytes (8533 bps)
Write zephyrproject-rtos#12: 192 bytes (9386 bps)
Write Complete (err 0)
Write zephyrproject-rtos#13: 208 bytes (8533 bps)
Write zephyrproject-rtos#14: 224 bytes (9244 bps)
Write zephyrproject-rtos#15: 240 bytes (9955 bps)
Write zephyrproject-rtos#16: 256 bytes (8000 bps)

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
nashif pushed a commit that referenced this pull request Nov 16, 2020
This makes the gatt metrics also available for
gatt write-without-rsp-cb so it now prints the rate of each write:

uart:~$ gatt write-without-response-cb 1e ff 10 10
Write #1: 16 bytes (0 bps)
Write #2: 32 bytes (3445948416 bps)
Write #3: 48 bytes (2596929536 bps)
Write #4: 64 bytes (6400 bps)
Write #5: 80 bytes (8533 bps)
Write #6: 96 bytes (10666 bps)
Write #7: 112 bytes (8533 bps)
Write #8: 128 bytes (9955 bps)
Write #9: 144 bytes (11377 bps)
Write #10: 160 bytes (7680 bps)
Write #11: 176 bytes (8533 bps)
Write #12: 192 bytes (9386 bps)
Write Complete (err 0)
Write #13: 208 bytes (8533 bps)
Write #14: 224 bytes (9244 bps)
Write #15: 240 bytes (9955 bps)
Write #16: 256 bytes (8000 bps)

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
fkan-ec pushed a commit to fkan-ec/zephyr that referenced this pull request Jan 17, 2022
gigiduck pushed a commit to gigiduck/zephyr that referenced this pull request Feb 7, 2022
NickolasLapp pushed a commit to NickolasLapp/zephyr that referenced this pull request Oct 19, 2022
LukaszMrugala pushed a commit to LukaszMrugala/zephyr that referenced this pull request Jul 3, 2024
- Minor cleanup, tweaks to tag_main.sh.
- Added the pr_comment.sh script
   * writes a comment to a PR with the rebase tag info
   * Works for both zephyr and zephyr-intel manifest update PRs

Signed-off-by: Connor Graydon <[email protected]>
cdesjardins pushed a commit to Arch-Embedded/zephyr that referenced this pull request Oct 22, 2024
…rproject-rtos#15)

Do not re-init PLLs after already being initialized

Approved-by: Fabian van den IJssel
Approved-by: Chris Desjardins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants